home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
comtecelectrical.ca
/
www.comtecelectrical.ca.tar
/
www.comtecelectrical.ca
/
infobots
/
Backup
/
MSOCache
/
All Users
/
90000409-6000-11D3-8CFE-0150048383C9
/
O1561415.CAB
/
MSO.DLL
/
226
/
650
next >
Wrap
Extensible Markup Language
|
2003-08-08
|
7KB
|
196 lines
<?xml version="1.0" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" indent="yes" />
<xsl:param name="BiDi">false</xsl:param>
<xsl:template match="/">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="ARTICLES">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="ARTICLE">
<xsl:choose>
<xsl:when test="Headword | */Headword">
<xsl:apply-templates select="Headword | */Headword"/>
</xsl:when>
<xsl:when test="Num">
<xsl:apply-templates select="Num"/>
</xsl:when>
<xsl:when test="NEWLINE">
<xsl:variable name="NextNewlineList" select="NEWLINE[1] | NEWLINE[1]/following-sibling::node()"></xsl:variable>
<xsl:variable name="CurrentList" select="node()"></xsl:variable>
<xsl:variable name="ApplyList" select="$CurrentList [ count( . | $NextNewlineList) != count( $NextNewlineList) ]"></xsl:variable>
<xsl:if test="$ApplyList">
<P>
<xsl:apply-templates select="$ApplyList"/>
</P>
</xsl:if>
<xsl:apply-templates select="NEWLINE"/>
</xsl:when>
<xsl:otherwise>
<P>
<xsl:apply-templates />
</P>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="Homograph">
<xsl:text> (</xsl:text>
<xsl:apply-templates />
<xsl:text>)</xsl:text>
</xsl:template>
<xsl:template match="Phon">
</xsl:template>
<xsl:template match="B">
<xsl:choose>
<xsl:when test="I">
<Char bold="true" italic="true">
<xsl:apply-templates select="I/text()"/>
</Char>
</xsl:when>
<xsl:otherwise>
<Char bold="true">
<xsl:apply-templates />
</Char>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="Headword">
<xsl:variable name="NextHeadwordList" select="following-sibling::Headword[1] | following-sibling::Headword[1]/following-sibling::node()"></xsl:variable>
<xsl:variable name="NextNumList" select="following-sibling::Num[1] | following-sibling::Num[1]/following-sibling::node()"></xsl:variable>
<xsl:variable name="NextNewlineList" select="following-sibling::NEWLINE[1] | following-sibling::NEWLINE[1]/following-sibling::node()"></xsl:variable>
<xsl:variable name="CurrentList" select="following-sibling::node()"></xsl:variable>
<xsl:variable name="ExcludeListHeadwordNum" select="$NextHeadwordList | $NextNumList"></xsl:variable>
<xsl:variable name="ExcludeList" select="$ExcludeListHeadwordNum | $NextNewlineList"></xsl:variable>
<xsl:variable name="ApplyList" select="$CurrentList [ count( . | $ExcludeList) != count( $ExcludeList) ]"></xsl:variable>
<xsl:variable name="NumList" select="following-sibling::Num [ count( . | $NextHeadwordList) != count( $NextHeadwordList) ]"></xsl:variable>
<xsl:variable name="NewlineList" select="following-sibling::NEWLINE [ count( . | $ExcludeListHeadwordNum) != count( $ExcludeListHeadwordNum) ]"></xsl:variable>
<Heading>
<Text>
<xsl:apply-templates/>
</Text>
<xsl:attribute name="level">2</xsl:attribute>
<xsl:attribute name="collapsible">true</xsl:attribute>
<xsl:attribute name="collapsed">false</xsl:attribute>
<xsl:variable name="sApplyList">
<xsl:apply-templates select="$ApplyList"/>
</xsl:variable>
<xsl:if test="$sApplyList!=''">
<xsl:if test="$ApplyList">
<P>
<xsl:apply-templates select="$ApplyList"/>
</P>
</xsl:if>
</xsl:if>
<xsl:if test="$NewlineList">
<xsl:apply-templates select="$NewlineList"/>
</xsl:if>
<xsl:if test="$NumList">
<xsl:apply-templates select="$NumList"/>
</xsl:if>
</Heading>
</xsl:template>
<xsl:template match="I">
<xsl:choose>
<xsl:when test="B">
<Char bold="true" italic="true">
<xsl:apply-templates select="B/text()"/>
</Char>
</xsl:when>
<xsl:otherwise>
<Char italic="true">
<xsl:apply-templates />
</Char>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="Label">
<Char smallCaps="true">
<xsl:apply-templates />
</Char>
</xsl:template>
<xsl:template match="Num">
<xsl:variable name="NextHeadwordList" select="following-sibling::Headword[1] | following-sibling::Headword[1]/following-sibling::node()"></xsl:variable>
<xsl:variable name="NextNumList" select="following-sibling::Num[1] | following-sibling::Num[1]/following-sibling::node()"></xsl:variable>
<xsl:variable name="NextNewlineList" select="following-sibling::NEWLINE[1] | following-sibling::NEWLINE[1]/following-sibling::node()"></xsl:variable>
<xsl:variable name="CurrentList" select="following-sibling::node()"></xsl:variable>
<xsl:variable name="ExcludeListHeadwordNum" select="$NextHeadwordList | $NextNumList"></xsl:variable>
<xsl:variable name="ExcludeList" select="$ExcludeListHeadwordNum | $NextNewlineList"></xsl:variable>
<xsl:variable name="ApplyList" select="$CurrentList [ count( . | $ExcludeList) != count( $ExcludeList) ]"></xsl:variable>
<xsl:variable name="NewlineList" select="following-sibling::NEWLINE [ count( . | $ExcludeListHeadwordNum) != count( $ExcludeListHeadwordNum) ]"></xsl:variable>
<P>
<xsl:choose>
<xsl:when test="$BiDi='false'">
<Char bold="true" rtl="false">
<xsl:apply-templates />
</Char>
</xsl:when>
<xsl:otherwise>
<Char bold="true" rtl="true">
<xsl:apply-templates />
</Char>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates select="$ApplyList"/>
</P>
<xsl:if test="$NewlineList">
<xsl:apply-templates select="$NewlineList"/>
</xsl:if>
</xsl:template>
<xsl:template match="NEWLINE">
<xsl:variable name="NextHeadwordList" select="following-sibling::Headword[1] | following-sibling::Headword[1]/following-sibling::node()"></xsl:variable>
<xsl:variable name="NextNumList" select="following-sibling::Num[1] | following-sibling::Num[1]/following-sibling::node()"></xsl:variable>
<xsl:variable name="NextNewlineList" select="following-sibling::NEWLINE[1] | following-sibling::NEWLINE[1]/following-sibling::node()"></xsl:variable>
<xsl:variable name="CurrentList" select="following-sibling::node()"></xsl:variable>
<xsl:variable name="ExcludeList" select="$NextHeadwordList | $NextNumList | $NextNewlineList"></xsl:variable>
<xsl:variable name="ApplyList" select="$CurrentList [ count( . | $ExcludeList) != count( $ExcludeList) ]"></xsl:variable>
<P>
<xsl:apply-templates/>
<xsl:apply-templates select="$ApplyList"/>
</P>
</xsl:template>
<xsl:template match="Pos">
<Char italic="true">
<xsl:apply-templates />
</Char>
</xsl:template>
<xsl:template match="Posc">
<Char italic="true">
<xsl:apply-templates />
</Char>
</xsl:template>
<xsl:template match="Text">
<Char>
<xsl:apply-templates />
</Char>
</xsl:template>
<xsl:template match="Super">
<Char superscript="true">
<xsl:apply-templates />
</Char>
</xsl:template>
<xsl:template match="Sub">
<Char subscript="true">
<xsl:apply-templates />
</Char>
</xsl:template>
<xsl:template match="Scaps">
<Char smallCaps="true">
<xsl:apply-templates />
</Char>
</xsl:template>
<xsl:template match="Headword2">
<xsl:variable name="sHeadword2">
<xsl:apply-templates />
</xsl:variable>
<xsl:if test="$sHeadword2!=''">
<Char bold="true">
<xsl:apply-templates />
</Char>
</xsl:if>
</xsl:template>
<xsl:template match="text()">
<xsl:value-of select="." />
</xsl:template>
</xsl:stylesheet>